#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef int SLDataType;
typedef struct SListNode
{
    struct SListNode* next;
    SLDataType Data;
}SLNode;
SLNode* BuyNode(SLDataType X)
{
    SLNode* newnode = (SLNode*)malloc(sizeof(SLNode));
    if (newnode == NULL)
    {
        printf("malloc is fail\n");
    }
    else
    {
        newnode->next = NULL;
        newnode->Data = X;
    }
    return newnode;
}
void SLNodePushBack(SLNode** pHead, SLDataType X)
{
    SLNode* newnode = BuyNode(X);
    if (*pHead == NULL)
    {
        *pHead = newnode;
    }
    else
    {
        SLNode* tail = *pHead;
        while (tail->next != NULL)
        {
            tail = tail->next;
        }
        tail->next = newnode;
    }
}
SLNode* SLNodeExchange(SLNode* pHead)
{
    SLNode* fir = pHead;
    SLNode* sec = fir->next;
    if (fir->next == NULL)
    {
        return fir;
    }
    else if (sec->next == NULL)
    {
        return fir;
    }
    else
    {
        fir->next = sec->next;
        sec->next = fir;
        SLNode* pre = NULL;
        SLNode* sta = sec;
        SLNode* aft = sec->next;
        while (aft->next != NULL)
        {
            pre = sta;
            sta = aft;
            aft = aft->next;
        }
        sta->next = NULL;
        aft->next = sta;
        pre->next = aft;
        return sec;
    }
}
void SLNodePrint(SLNode* newHead)
{
    SLNode* cur = newHead;
    while (cur != NULL)
    {
        printf("%d ", cur->Data);
        cur = cur->next;
    }
}
int main()
{
    SLNode* PList = NULL;
    int i, n = 0;
    int arr[100] = { 0 };
    scanf("%d\n", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d ", &arr[i]);
        SLNodePushBack(&PList, arr[i]);
    }
    SLNode* sec = SLNodeExchange(PList);
    SLNodePrint(sec);
    return 0;
}